home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / hlp_auth / blun20 / generapp.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-10  |  13.8 KB  |  358 lines

  1. VERSION 2.00
  2. Begin Form Balloon_Form 
  3.    Caption         =   "BALLOON Test"
  4.    ClientHeight    =   6510
  5.    ClientLeft      =   1020
  6.    ClientTop       =   1845
  7.    ClientWidth     =   5085
  8.    ClipControls    =   0   'False
  9.    Height          =   7200
  10.    Left            =   960
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6510
  13.    ScaleWidth      =   5085
  14.    Top             =   1215
  15.    Width           =   5205
  16.    Begin BALLOON Balloon1 
  17.       Prop16          =   "Click for About Box"
  18.       BackColor       =   &H0080FFFF&
  19.       BalloonArrow    =   0   'False
  20.       Prop24          =   -1  'True
  21.       ForeColor       =   &H00000000&
  22.       InverseVideo    =   0   'False
  23.       Left            =   2400
  24.       Top             =   3480
  25.    End
  26.    Begin ComboBox Combo1 
  27.       Height          =   300
  28.       Left            =   240
  29.       TabIndex        =   15
  30.       Tag             =   "Combo1 tag text"
  31.       Text            =   "Combo1"
  32.       Top             =   2880
  33.       Width           =   2175
  34.    End
  35.    Begin CommandButton BTN_Dialog 
  36.       Caption         =   "Dialog"
  37.       Height          =   375
  38.       Left            =   240
  39.       TabIndex        =   14
  40.       Tag             =   "BTN_Dialog tag text"
  41.       Top             =   240
  42.       Width           =   1335
  43.    End
  44.    Begin OptionButton Option3 
  45.       Caption         =   "Maybe option"
  46.       Height          =   255
  47.       Left            =   1200
  48.       TabIndex        =   13
  49.       Tag             =   "Option3 tag text"
  50.       Top             =   4320
  51.       Width           =   1575
  52.    End
  53.    Begin PictureBox Picture1 
  54.       ClipControls    =   0   'False
  55.       Height          =   11520
  56.       Left            =   0
  57.       ScaleHeight     =   11490
  58.       ScaleWidth      =   15330
  59.       TabIndex        =   3
  60.       Top             =   0
  61.       Width           =   15360
  62.    End
  63.    Begin CheckBox Check2 
  64.       Caption         =   "That"
  65.       Height          =   255
  66.       Left            =   1200
  67.       TabIndex        =   11
  68.       Tag             =   "Check2 tag text"
  69.       Top             =   3840
  70.       Width           =   1200
  71.    End
  72.    Begin CheckBox Check1 
  73.       Caption         =   "This"
  74.       Height          =   255
  75.       Left            =   1200
  76.       TabIndex        =   10
  77.       Tag             =   "Check1 tag text"
  78.       Top             =   3360
  79.       Width           =   1200
  80.    End
  81.    Begin Frame Frame1 
  82.       Caption         =   "Do it now"
  83.       Height          =   1215
  84.       Left            =   3000
  85.       TabIndex        =   7
  86.       Tag             =   "Frame1 tag text"
  87.       Top             =   3120
  88.       Width           =   1695
  89.       Begin OptionButton Option2 
  90.          Caption         =   "No"
  91.          Height          =   255
  92.          Left            =   240
  93.          TabIndex        =   9
  94.          Tag             =   "Option2 tag text"
  95.          Top             =   720
  96.          Width           =   1000
  97.       End
  98.       Begin OptionButton Option1 
  99.          Caption         =   "Yes"
  100.          Height          =   255
  101.          Left            =   240
  102.          TabIndex        =   8
  103.          Tag             =   "Option1 tag text"
  104.          Top             =   360
  105.          Width           =   1000
  106.       End
  107.    End
  108.    Begin TextBox TXT_Result 
  109.       Height          =   1575
  110.       Left            =   120
  111.       MultiLine       =   -1  'True
  112.       TabIndex        =   6
  113.       Tag             =   "TXT_Result tag text"
  114.       Text            =   "Status output"
  115.       Top             =   4800
  116.       Width           =   4815
  117.    End
  118.    Begin TextBox TXT_KeyString 
  119.       Height          =   375
  120.       Left            =   120
  121.       TabIndex        =   3
  122.       Tag             =   "TXT_KeyString tag text."
  123.       Text            =   "This is a popup message to display in the window. The message can be of long length, or it can be short."
  124.       Top             =   1440
  125.       Width           =   4815
  126.    End
  127.    Begin CommandButton BTN_Exit 
  128.       Caption         =   "Exit"
  129.       Height          =   375
  130.       Left            =   3480
  131.       TabIndex        =   2
  132.       Tag             =   "BTN_Exit tag text"
  133.       Top             =   240
  134.       Width           =   1455
  135.    End
  136.    Begin TextBox TXT_SearchString 
  137.       Height          =   375
  138.       Left            =   120
  139.       TabIndex        =   1
  140.       Tag             =   "TXT_SearchString tag text"
  141.       Text            =   "Dawg"
  142.       Top             =   2280
  143.       Width           =   4815
  144.    End
  145.    Begin CommandButton Btn_HelpSession 
  146.       Caption         =   "Help Balloons"
  147.       Height          =   375
  148.       Left            =   1800
  149.       TabIndex        =   0
  150.       Tag             =   "Btn_HelpSession tag text"
  151.       Top             =   240
  152.       Width           =   1455
  153.    End
  154.    Begin Label Label3 
  155.       Alignment       =   2  'Center
  156.       Caption         =   "Search String"
  157.       Height          =   255
  158.       Left            =   120
  159.       TabIndex        =   5
  160.       Top             =   1920
  161.       Width           =   4815
  162.    End
  163.    Begin Label Label1 
  164.       Alignment       =   2  'Center
  165.       Caption         =   "Key String"
  166.       Height          =   255
  167.       Left            =   120
  168.       TabIndex        =   4
  169.       Top             =   1080
  170.       Width           =   4815
  171.    End
  172.    Begin Menu nmu_File 
  173.       Caption         =   "&File"
  174.       Begin Menu mnu_Exit 
  175.          Caption         =   "&Exit"
  176.       End
  177.    End
  178.    Begin Menu mnu_Edit 
  179.       Caption         =   "&Edit"
  180.       Begin Menu mnu_Cut 
  181.          Caption         =   "Cu&t"
  182.       End
  183.       Begin Menu mnu_Copy 
  184.          Caption         =   "&Copy"
  185.       End
  186.       Begin Menu mnu_Paste 
  187.          Caption         =   "&Paste"
  188.       End
  189.       Begin Menu mnu_submenu 
  190.          Caption         =   "SubMenu"
  191.          Begin Menu mnu_submenu1 
  192.             Caption         =   "SubMenu 1"
  193.          End
  194.          Begin Menu mnu_submenu2 
  195.             Caption         =   "SubMenu 2"
  196.          End
  197.       End
  198.    End
  199.    Begin Menu mnu_help 
  200.       Caption         =   "&Help"
  201.       Begin Menu mnu_HelpBalloons 
  202.          Caption         =   "Help &Balloons"
  203.       End
  204.    End
  205. Option Explicit
  206. ' Declare statements for utility functions included in BALLOON.VBX
  207. Declare Function Hwnd2ControlTabIndex Lib "BALLOON.VBX" (ByVal hwndControl%) As Integer
  208. Declare Function Hwnd2CtlName Lib "BALLOON.VBX" (ByVal hwndControl%) As String
  209. Declare Function Hwnd2HelpContextID Lib "BALLOON.VBX" (ByVal hwndControl%) As Long
  210. Declare Function Hwnd2TagText Lib "BALLOON.VBX" (ByVal hwndControl%) As String
  211. Sub Balloon1_BalloonClick (hwndAtMouse As Integer)
  212. ' PURPOSE:  hwndAtMouse is the control the mouse is over
  213. ' COMMENTS: pass back the help text
  214. '           shows how to programmatcially end a session
  215. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  216. Dim Msg As String
  217. Dim CRLF As String
  218. Dim TestText As String
  219.     CRLF = Chr$(13) + Chr$(10)
  220.     TestText = "Use the balloon utility functions to retrieve other control properties. Display these properties in the ballon if desired." + CRLF
  221.     TestText = TestText + "CtlName = " + Hwnd2CtlName(hwndAtMouse) + CRLF
  222.     TestText = TestText + "Tag text = " + Hwnd2TagText(hwndAtMouse) + CRLF
  223.     TestText = TestText + "HelpContextID = " + Str$(Hwnd2HelpContextID(hwndAtMouse)) + CRLF
  224.     TestText = TestText + "ControlTabIndex = " + Str$(Hwnd2ControlTabIndex(hwndAtMouse))
  225.     TXT_Result.Text = TestText
  226.     Select Case hwndAtMouse
  227.         Case Me.hWnd
  228.             Exit Sub    ' do nothing
  229.         Case BTN_Dialog.hWnd
  230.             'TestText = Hwnd2TagText$(hwndAtMouse)
  231.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  232.             
  233.             ' set font and back colors dynamically
  234.             Balloon1.ForeColor = QBColor(0)
  235.             Balloon1.BackColor = QBColor(2)
  236.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Dialog."
  237.         Case Btn_HelpSession.hWnd
  238.             'TestText = Hwnd2TagText$(hwndAtMouse)
  239.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  240.             
  241.             ' set font and back colors dynamically
  242.             Balloon1.ForeColor = &HFF0000    ' blue
  243.             Balloon1.BackColor = &HC0C0C0    ' light grey
  244.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Btn_HelpSession."
  245.         Case BTN_Exit.hWnd
  246.             'TestText = Hwnd2TagText$(hwndAtMouse)
  247.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  248.             
  249.             ' set font and back colors dynamically
  250.             Balloon1.ForeColor = QBColor(4)
  251.             Balloon1.BackColor = QBColor(14)
  252.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Exit."
  253.         Case TXT_KeyString.hWnd
  254.             'TestText = Hwnd2TagText$(hwndAtMouse)
  255.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  256.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_KeyString."
  257.         Case TXT_SearchString.hWnd
  258.             'TestText = Hwnd2TagText$(hwndAtMouse)
  259.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  260.             
  261.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_SearchString."
  262.         Case TXT_Result.hWnd
  263.             'TestText = Hwnd2TagText$(hwndAtMouse)
  264.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  265.             
  266.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_Result."
  267.         Case Picture1.hWnd
  268.             'TestText = Hwnd2TagText$(hwndAtMouse)
  269.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  270.             
  271.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Picture1."
  272.         Case Check1.hWnd
  273.             'TestText = Hwnd2TagText$(hwndAtMouse)
  274.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  275.             
  276.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check1."
  277.         Case Check2.hWnd
  278.             'TestText = Hwnd2TagText$(hwndAtMouse)
  279.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  280.             
  281.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check2."
  282.         Case Frame1.hWnd
  283.             'TestText = Hwnd2TagText$(hwndAtMouse)
  284.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  285.             
  286.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Frame1."
  287.         Case Option1.hWnd
  288.             'TestText = Hwnd2TagText$(hwndAtMouse)
  289.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  290.             
  291.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option1."
  292.         Case Option2.hWnd
  293.             'TestText = Hwnd2TagText$(hwndAtMouse)
  294.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  295.             
  296.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option2."
  297.         Case Option3.hWnd
  298.             'TestText = Hwnd2TagText$(hwndAtMouse)
  299.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  300.             
  301.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option3."
  302.         Case Combo1.hWnd
  303.             'TestText = Hwnd2TagText$(hwndAtMouse)
  304.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  305.             
  306.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Combo1."
  307.         Case Else
  308.         
  309.         End Select
  310.         
  311. End Sub
  312. Sub Balloon1_BalloonSessionEndClick ()
  313. ' PURPOSE:  Notify the application when the balloon goes off screen
  314. ' Comments: Use this event to clean up the application after a balloon seesion
  315. '           USE IS OPTIONAL
  316. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  317.     TXT_Result.Text = "Balloon session end notify click"
  318. End Sub
  319. Sub BTN_Dialog_Click ()
  320.     Dialog.Show
  321. End Sub
  322. Sub BTN_Exit_Click ()
  323.     mnu_Exit_Click
  324. End Sub
  325. Sub Btn_HelpSession_Click ()
  326.     ' initial help text string
  327.     ' here we get the text from the on screen text box
  328.     '
  329.     ' Initial text can be left blank, if blank then
  330.     ' Balloon.vbx control will display an internal init message
  331.     Balloon1.MessageText = TXT_KeyString.Text
  332.     Balloon1.Action = 20     ' Balloon_START = 20
  333. End Sub
  334. Sub Form_Load ()
  335.     If Me.WindowState = 0 Then
  336.         Me.Top = 0
  337.         Me.Left = 0
  338.     End If
  339. End Sub
  340. Sub Form_Resize ()
  341.     If Me.WindowState = 0 Then
  342.         Me.Height = 7200
  343.         Me.Width = 5175
  344.     End If
  345. End Sub
  346. Sub mnu_Exit_Click ()
  347.     End
  348. End Sub
  349. Sub mnu_HelpBalloons_Click ()
  350.     ' initial help text string
  351.     ' here we get the text from the on screen text box
  352.     '
  353.     ' Initial text can be left blank, if blank then
  354.     ' Balloon.vbx control will display an internal init message
  355.     Balloon1.MessageText = TXT_KeyString.Text
  356.     Balloon1.Action = 20     ' Balloon_START = 20
  357. End Sub
  358.